package com.redbox.RedboxManagment.ejb;
// Generated Feb 3, 2012 8:49:43 AM by Hibernate Tools 3.1.0.beta4

import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * Order generated by hbm2java
 */
@Entity
@Table(name="Order"
    ,catalog="redbox_db"
, uniqueConstraints = {  }
)

public class Order  implements java.io.Serializable {


    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// Fields    

     private int idOrder;
     private OrderStatus orderStatus;
     private Client client;
     private User user;
     private String number;
     private boolean type;
     private Date date;
     private float profitCost;
     private float shippingCost;
     private float totalPayment;
     private float totalCost;
     private List<Product> products;
     private List<Payment> payments;


    // Constructors

    /** default constructor */
    public Order() {
    }
   
    // Property accessors
    @Id
    @Column(name="idOrder", unique=true, nullable=false, insertable=true, updatable=true)

    public int getIdOrder() {
        return this.idOrder;
    }
    
    public void setIdOrder(int idOrder) {
        this.idOrder = idOrder;
    }
    @ManyToOne(cascade={},
        fetch=FetchType.LAZY)
    
        @JoinColumn(name="idOrderStatus", unique=false, nullable=false, insertable=true, updatable=true)

    public OrderStatus getOrderStatus() {
        return this.orderStatus;
    }
    
    public void setOrderStatus(OrderStatus orderstatus) {
        this.orderStatus = orderstatus;
    }
    @ManyToOne(cascade={},
        fetch=FetchType.LAZY)
    
        @JoinColumn(name="idClient", unique=false, nullable=false, insertable=true, updatable=true)

    public Client getClient() {
        return this.client;
    }
    
    public void setClient(Client client) {
        this.client = client;
    }
    @ManyToOne(cascade={},
        fetch=FetchType.LAZY)
    
        @JoinColumn(name="idUser", unique=false, nullable=false, insertable=true, updatable=true)

    public User getUser() {
        return this.user;
    }
    
    public void setUser(User user) {
        this.user = user;
    }
    @Column(name="number", unique=false, nullable=false, insertable=true, updatable=true, length=45)

    public String getNumber() {
        return this.number;
    }
    
    public void setNumber(String number) {
        this.number = number;
    }
    @Column(name="type", unique=false, nullable=false, insertable=true, updatable=true)

    public boolean isType() {
        return this.type;
    }
    
    public void setType(boolean type) {
        this.type = type;
    }
    @Column(name="date", unique=false, nullable=false, insertable=true, updatable=true, length=19)

    public Date getDate() {
        return this.date;
    }
    
    public void setDate(Date date) {
        this.date = date;
    }
    @Column(name="profitCost", unique=false, nullable=false, insertable=true, updatable=true, precision=12, scale=0)

    public float getProfitCost() {
        return this.profitCost;
    }
    
    public void setProfitCost(float profitCost) {
        this.profitCost = profitCost;
    }
    @Column(name="shippingCost", unique=false, nullable=false, insertable=true, updatable=true, precision=12, scale=0)

    public float getShippingCost() {
        return this.shippingCost;
    }
    
    public void setShippingCost(float shippingCost) {
        this.shippingCost = shippingCost;
    }
    @Column(name="totalPayment", unique=false, nullable=false, insertable=true, updatable=true, precision=12, scale=0)

    public float getTotalPayment() {
        return this.totalPayment;
    }
    
    public void setTotalPayment(float totalPayment) {
        this.totalPayment = totalPayment;
    }
    @Column(name="totalCost", unique=false, nullable=false, insertable=true, updatable=true, precision=12, scale=0)

    public float getTotalCost() {
        return this.totalCost;
    }
    
    public void setTotalCost(float totalCost) {
        this.totalCost = totalCost;
    }
    
    @OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.LAZY, mappedBy="order")
    public List<Product> getProducts() {
        return this.products;
    }
    
    public void setProducts(List<Product> products) {
        this.products = products;
    }
    
    @OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.LAZY, mappedBy="order")
    public List<Payment> getPayments() {
        return this.payments;
    }
    
    public void setPayments(List<Payment> payments) {
        this.payments = payments;
    }

}
